package DataBaseQuery;

import java.util.ArrayList;



public class OrCondition extends Condition {
	ArrayList<Condition> conditions;
	public OrCondition()
	{
		conditions = new ArrayList<Condition>();
	}
	
	public void add(Condition c)
	{
		conditions.add(c);
	}
	
	@Override
	public boolean isTrue()
	{
		
		for (Condition con : conditions) {
			if(con.isTrue())
				return  true;
		}
		return false;
	}
	@Override
	public boolean isTrue(RegularView v)
	{
		
		for (Condition con : conditions) {
			if(con.isTrue(v))
				return  true;
		}
		return false;
	}
	@Override
	public boolean checkInvalidVarible()
	{
		for (Condition con : conditions) {
			if(!con.checkInvalidVarible())
				return false;
		}
		return true;
	}
}
